package com.woniu.his.dao;

import com.woniu.his.entity.MedicalDetailInfo;
import com.woniu.his.entity.MedicalDetailInfo;
import com.woniu.his.entity.MedicalInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import java.util.List;
import java.util.Map;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author TATO
 * @since 2019-11-25
 */
public interface MedicalInfoMapper extends BaseMapper<MedicalInfo> {
    List<MedicalDetailInfo> getMedicalDetailInfoByPatientId(int patientId);


    MedicalDetailInfo getMedicalDetailInfoByMedicalId(int medicalId);
    @Select("select * from medical_info where medical_id = #{medicalId}")
    MedicalInfo selectMedicalInfoByMedicalId(int medicalId);
    @Select("select m.medical_id medicalId, p.patient_name patientName from medical_info m left join patient_info p on m.patient_id = p.patient_id where m.`status` = 1;\n")
    List<Map<String, Object>> queryDrugMedical();
}
